<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('users', function(Blueprint $table)
		{
            $table->engine = 'InnoDB';
			$table->increments('id');
            $table->string('username');
            $table->string('password');
            $table->string('firstname')->nullable();
            $table->string('lastname')->nullable();
            $table->string('email');
            $table->integer('role')->unsigned();
            $table->foreign('role')->references('id')->on('role');
            $table->string('avatar')->nullable();
            $table->string('status')->default('inactive');
            $table->string('sex')->nullable();
            $table->text('description_me')->nullable();
            $table->date('birthday')->nullable();
            $table->integer('contribution_value')->nullable();
            $table->string('remember_token')->nullable();
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}

}
